<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>自定义表</title>
        <#include "/pubHeadStyle.html">
        <link rel="stylesheet" href="${ctx}/css/form.css">
        <script src="${ctx}/extends/jquery.min.js" type="text/javascript"></script>
        <script src="${ctx}/formStatic/verify.js" type="text/javascript"></script>

    </head>
    <body>
        <script>
            var isAdd = '${isAdd}';
            var editIndex = '${editIndex}';
            var tableId = '${tableId}';
            var editFieldName = '${editFieldName}';
            var isExternal = '${isExternal}';
        </script>
        <style>
            #LAY_app {
                background: #fff;
            }

            .block-select-root .layui-form-select{
                width:100%;
            }

            .layui-tree li {
                width: 180px;
                overflow: visible;
            }

            .layui-tree li a {
                display: inline-block;
                width: 180px;
            }

            .layui-tree li a cite {
                display: inline-block;
                width: 139px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }

            .fontColor {
                color: #fff !important;
            }

            .layui-form-checked[lay-skin=primary] i {
                background-color: #bbb !important;
            }

            .dicTree .layui-form-select dl dd{
                overflow-x:auto;
            }
        </style>

        <form class="layui-form addColForm" lay-filter="formData" id="formData" style="height:467px;background: #fff">
            <div class="layui-btn-container" style="position: absolute;bottom: 0;left:43%">
                <button type="button" class="layui-btn" lay-submit lay-filter="fieldForm" id="addFieldInfo">添加</button>
                <button class="layui-btn" lay-submit lay-filter="fieldForm" style="display:none"
                        id="editFieldButton">保存
                </button>
                <a class="layui-btn layui-btn-danger" id="goBack">取消</a>
            </div>
            <div class="addCol" style="padding-top:10px;height: 380px;overflow-y: auto;">
                <div class="layui-form-item">
                    <div class="layui-inline" style="width:355px">
                        <label class="layui-form-label">字段描述:</label>
                        <div class="layui-input-block">
                            <input type="text" name="fieldDesc" id="fieldDesc" class="layui-input" placeholder="字段描述"
                                   style="width: 190px;" maxlength="64"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">字段名称:<span style="color:red;">*</span></label>
                        <div class="layui-input-block">
                            <input type="text" name="fieldName" id="fieldName" lay-verify="required|fieldName"
                                   class="layui-input"
                                   placeholder="字段名称" maxlength="20"/>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline" style="width: 355px;">
                        <label class="layui-form-label">字段类型:</label>
                        <div class="layui-input-block block-select-root" style="width: 190px;">
                            <div class="fieldChoise">
                                <select name="fieldType" lay-filter="fieldType" id="fieldType">
                                    <option value="varchar">文字</option>
                                    <option value="number">数字</option>
                                    <option value="date">日期</option>
                                    <option value="clob">大文本</option>
                                </select>
                            </div>
                            <div class="time">
                                <span id="spanDateFormat" style="display: none;float:left;">
                                    <span>取当前日期:</span>
                                    <input type="checkbox" lay-skin="primary"
                                                              name="isCurrentDate" id="isCurrentDate"
                                                              style="float: left;"/>
                                    <select id="selDateFormat" name="selDateFormat">
                                        <option value="year">yyyy</option>
                                        <!--<option value="month">yyyy-MM</option>-->
                                        <option value="date">yyyy-MM-dd</option>
                                        <option value="datetime">yyyy-MM-dd HH:mm:ss</option>
                                        <option value="time">HH:mm:ss</option>
                                    </select>
                                </span>
                            </div>

                        </div>
                    </div>
                    <div class="layui-inline labeLength">
                        <label class="layui-form-label">长度: </label>
                        <div class="layui-input-block length">
                            <input type="text" id="charLen" lay-verify="positiveInteger" name="charLen"
                                   class="layui-input"
                                   placeholder="长度" value="50"/>
                        </div>
                        <div class="layui-input-block number" style="display:none;position: relative; width: 380px;">
                            <div class="currency" style="float: left;width: 165px;">
                                <span style="display: inline-block;">千分位</span><input type="checkbox" lay-skin="primary"
                                                                                      name="isShowComdify"
                                                                                      id="isShowComdify"
                                                                                      style="float: left"/>
                                <span style="display: inline-block;">货币</span><input type="checkbox" lay-skin="primary"
                                                                                     name="coinType"
                                                                                     lay-filter="coinType" id="coinType"
                                                                                     style="float: left"/>
                            </div>
                            <div style="position: absolute;left: 34%;height: 32px;" id="coinValueDiv">
                                <select id="coinValue" name="coinValue" lay-filter="coinValue">
                                    <option value="￥">￥人民币</option>
                                    <option value="$">$美元</option>
                                </select>
                            </div>
                            <div style="float: right;margin-right:16%" id="num">
                                <div class="integer" style="float: left">
                                    <span style="margin-top: 10px;display: inline-block;">整数位</span> <input type="text"
                                                                                                            name="intLen"
                                                                                                            id="intLen"
                                                                                                            class="layui-input"
                                                                                                            value="13"
                                                                                                            style="float: right;width: 35px"/>
                                </div>
                                <div class="decimal" style="float: left">
                                    <span style="margin-top: 10px;display: inline-block;">小数位</span> <input type="text"
                                                                                                            name="decimalLen"
                                                                                                            id="decimalLen"
                                                                                                            class="layui-input"
                                                                                                            value="0"
                                                                                                            style="float: right;width: 35px"/>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">选项: </label>
                    <div class="layui-input-block" style="width: 72%">
                        <input type="checkbox" id="isRequired" lay-skin="primary" name="isRequired" title="必填"/>
                        <input type="checkbox" id="isList" lay-skin="primary" name="isList" checked title="显示到列表"/>
                        <input type="checkbox" id="isQuery" lay-skin="primary" name="isQuery" title="作为查询条件"/>
                        <input type="checkbox" id="isFlowVar" lay-skin="primary" name="isFlowVar" title="是否流程变量"/>
                        <span id="showIsReference" style="display:none; vertical-align: top">
                    <input type="checkbox" id="isReference" lay-skin="primary" name="isReference" title="作为超链接"/>
            </span>
                    </div>
                </div>
                <div class="divWidthSytle">
                    <div class="layui-form-item">
                        <label class="layui-form-label">值来源: </label>
                        <div class="layui-input-block block-select">
                            <select id="valueFrom" name="valueFrom" lay-filter="valueFrom">
                                <option value="0">表单输入</option>
                                <option value="1">脚本运算(显示)</option>
                                <option value="2">脚本运算(不显示)</option>
                                <option value="3">流水号</option>
                            </select>
                            <div style="margin-left:200px;display:none" class="serNumber">
                                <input type="hidden" value="" name="identityAlias" id="identityAlias">
                                <input type="text" name="identityName" id="identityName" class="layui-input"
                                       placeholder="流水号"
                                       style="width:100px;float: left;margin-top:4px;" readonly/>
                                <button type="button" class="layui-btn layui-btn-sm" id="serNum"
                                        style="float:left;margin:7px 5px 0 5px;">选择
                                </button>
                                <input type="checkbox" lay-skin="primary" name="isShowidentity" id="isShowidentity"
                                       title="是否显示在启动流程中"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="conTypes">
                    <div class="layui-form-item">
                        <label class="layui-form-label">控件类型: </label>
                        <div class="layui-input-block block-select">
                            <select id="controlType" name="controlType" lay-filter="controlType">
                                <option value="1">单行文本框</option>
                                <option value="2">多行文本框</option>
                                <option value="3">数据字典</option>
                                <option value="4">人员选择器(单选)</option>
                                <option value="8">人员选择器(多选)</option>
                                <option value="17">角色选择器(单选)</option>
                                <option value="5">角色选择器(多选)</option>
                                <option value="18">组织选择器(单选)</option>
                                <option value="6">组织选择器(多选)</option>
                                <option value="19">岗位选择器(单选)</option>
                                <option value="7">岗位选择器(多选)</option>
                                <option value="16">隐藏域</option>
                                <option value="9">文件上传</option>
                                <option value="11">下拉选项</option>
                                <option value="13">复选框</option>
                                <option value="14">单选按钮</option>
                                <option value="15">日期控件</option>
                                <!--<option value="20">流程引用</option>-->
                                <option value="22">图片展示控件</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="dataDic" style="display: none;position: relative;">
                    <div class="layui-form-item dicTree">
                        <label class="layui-form-label">数据字典类型: </label>
                        <div class="layui-unselect layui-form-select downpanel"
                             style=" position: absolute;top:5%;left:123px;width: 200px;">
                            <div class="layui-select-title">
                    <span class="layui-input layui-unselect" id="treeclass"
                          style="color:#000;line-height: 36px;overflow: hidden"></span>
                                <input type="hidden" name="selectID" value="0">
                                <i class="layui-edge"></i>
                            </div>
                            <dl class="layui-anim layui-anim-upbit">
                                <dd>
                                    <ul id="classtree"></ul>
                                </dd>
                            </dl>
                        </div>
                    </div>
                </div>
                <div class="validationRule">
                    <div class="layui-form-item">
                        <label class="layui-form-label">验证规则: </label>
                        <div class="layui-input-block block-select">
                            <select lay-filter="validRule" name="validRule" id="validRule">
                                <option value="">无</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="divWidthSytle" id="encryptDiv">
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否加密: </label>
                        <div class="layui-input-block" style="width: 72%">
                            <input type="radio" name="isEncrypt" lay-filter="erweima" value="0" title="否" checked>
                            <input type="radio" name="isEncrypt" lay-filter="erweima" value="1" title="是">

                        </div>
                    </div>
                </div>
                <div class="dropDown" style="display:none;">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="background: none;border-right:none">下拉选项: </label>
                        <div class="layui-input-block" style="margin-left:118px;">
                            <button type="button" id="addList" style="margin:5px;" class="layui-btn layui-btn-sm">添加
                            </button>
                            <div class="addFrom">

                            </div>
                        </div>
                    </div>
                </div>
                <div class="limit" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">限定类型: </label>
                        <div class="layui-input-block block-select">
                            <select id="fromType" name="fromType" lay-filter="fromType">
                                <option value="all" type="system">全部</option>
                                <option value="self" type="system">本级和下级</option>
                                <option value="department" type="system">部门</option>
                                <option value="up" type="system">上级</option>
                                <option value="grade" type="system">集团</option>
                                <option value="company" type="system">分公司</option>
                                <option value="" type="script">脚本</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="user" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">显示当前用户: </label>
                        <div class="layui-input-block">
                            <input type="checkbox" lay-skin="primary" name="showCurUser" id="showCurUser"
                                   style="float: left;"/>
                        </div>
                    </div>
                </div>
                <div class="org" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">显示当前组织: </label>
                        <div class="layui-input-block">
                            <input type="checkbox" lay-skin="primary" name="showCurOrg" id="showCurOrg"
                                   style="float: left;"/>
                        </div>
                    </div>
                </div>
                <div class="pos" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">显示当前岗位: </label>
                        <div class="layui-input-block">
                            <input type="checkbox" lay-skin="primary" name="showCurPos" id="showCurPos"
                                   style="float: left;"/>
                        </div>
                    </div>
                </div>
                <div class="encAlgorithm" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">加密算法: </label>
                        <div class="layui-input-block">
                            <input type="text" name="encrypt" id="encrypt" value="formFieldEncryptService.encryptField"
                                   style="margin-top:0"
                                   class="layui-input"
                                   placeholder="请输入加密类.方法名"/>
                        </div>
                    </div>
                </div>
                <div class="decAlgorithm" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label">解密算法: </label>
                        <div class="layui-input-block">
                            <input type="text" name="decrypt" id="decrypt" class="layui-input" style="margin-top:0"
                                   value="formFieldEncryptService.decryptField" placeholder="请输入解密类.方法名"/>
                        </div>
                    </div>
                </div>
                <div class="script" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="height:188px">脚本: </label>
                        <div class="layui-input-block" style="width: 75%;">
                            <div id="commonScript" style="cursor: pointer;color:blue">
                                <button type="button" class="layui-btn layui-btn-xs"><i
                                        class="layui-icon layui-icon-link"></i>常用脚本
                                </button>
                            </div>
                            <p>[CUR_USER]：当前人id, [CUR_ORG]：当前人组织id, [CUR_POS]：当前人岗位id。</p>
                            <textarea id="script" codemirror="true" name="script" rows="6" cols="80"></textarea>
                        </div>
                    </div>
                </div>
                <div class="IDScript" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="height:188px">ID脚本: </label>
                        <div class="layui-input-block" style="width: 75%;">
                            <div id="commonScriptId" style="cursor: pointer;color:blue">
                                <button type="button" class="layui-btn layui-btn-xs"><i
                                        class="layui-icon layui-icon-link"></i>常用脚本
                                </button>
                            </div>
                            <p>脚本中要使用到其他字段参与运算， 请使用“[字段名]”方式引用。</p>
                            <textarea id="scriptID" codemirror="true" mirrorheight="80px" name="scriptID" rows="6"
                                      cols="80"
                            ></textarea>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item" id="uploadFileDiv" style="display: none">
                    <label class="layui-form-label">直接上传文件: </label>
                    <div class="layui-input-block">
                        <input type="checkbox" id="isDirectUpLoad" lay-skin="primary" name="isDirectUpLoad"/>
                    </div>
                </div>
                <div class="layui-form-item" id="uploadFileTypeDiv" style="display: none">
                    <label class="layui-form-label">上传文件类型: </label>
                    <div class="layui-input-block">

                    </div>
                </div>
            </div>
        </form>
        <script src="${ctx}/formStatic/table/addCol.js" type="text/javascript"></script>
    </body>
</html>


